I am looking for an existing algorithm for images (squares) layout similar to this:

Is anyone aware of something similar? Maybe a library or just a description? It would be something like this:
- Place image somewhere in the 2D space
- Continue arranging remaining images around it (various sizes, but smaller than the first one)
Any help is greatly appreciated!
