(html) fit images in an html page
<p>There are several images in folder . I want to fit as many images as possible from the folder into an html page. The images will be selected at random and will have different width &amp; height. I don't want the dimension of the images to change.</p>

<p>How can this be accomplished ?? is this doable with JavaScript ?
This looks pretty complicated to me . is there a simple way of doing this via some other method (server side)? </p>

<p>thanks</p>

<p>Edit: so basically we have a room in which we want to pack as many boxes as we can , the boxes all have different size and cannot be stacked over one another..</p>
