Arrange images and scale to fit a defined area
<p>I'm looking for a script that will take a bunch of images (of differing widths and heights) and arrange them into a perfect rectangle as shown below;</p>

<p><img src="http://i.stack.imgur.com/tUHzg.gif" alt="enter image description here"></p>

<p>I have been looking at isotope (http://isotope.metafizzy.co/demos/images.html), but it doesn't resize the images to fit neatly.</p>

<p>Wondering if there is some javascript or php that could do this?</p>

<p>Thanks.</p>
