auto resize images so they fit in a window
<p>I have a gallery that is page with just a bunch of images. Nothing else.</p>

<p>And I want to resize and reduce/increase the number of images on a row depending on the with of the browser window.</p>

<p>Right now I have a fixed number if images per row.</p>

<pre><code>imgSize = documentWidth/18;
</code></pre>

<p>With my browser window (1770px), this produces 18 images on one row á 98.3px wide.
But if the users window is a lot smaller than mine, let's say 962px, the images will be 53.4px wide which is to small.
I want them around 100px.</p>

<p>So I need to calculate how many images will fit on one row if the window size is X and the image cannot be larger than 120px and smaller than 80px.</p>
