I am working on an application that will get images from SD-Card and will respectively show them in the layout like this

The Issue is:
Lets say the user has 100+ files in the SD-Card, to show them in the layout i need to add first 100+ views and then i would do the styling. Wrong approach
My Question is:
What can be done either progamatically or through XML so that i could define only five basic views and depending upon the number of images in the SD-card, it creates the remaining Layouts and views so that i can access them through horizontal scroll view.
My research includes:
I tried using the Grid view layout but it does not full fill my needs as it has a uniform size for all grids. more over i know how to add a layout programmatically but i do not know how to make it work with my design.