The algorithm for a perfectly balanced photo gallery
i made a library for this:<p><a href="https://github.com/jonathanong/horizontal-grid-packing" rel="nofollow">https://github.com/jonathanong/horizontal-grid-packing</a>