Complex random grid - Flashon

You guys problably already saw the amazing adobe flashon website?
If not be sure to check it out.

Now I want to make a similar random grid of images. But I don’t know how to start on this project. How would you do it?
I mean how to prevent the images from overlapping each other or how to fill the gaps?

Thx for your thoughts!