hi, im using this code that displays X amount of images from a facebook page. the width and height is preset. Id like to generate the width for each image, so that all images would have different sizes when they are displayed.

Id also like to set a max width and a min width, so no images are larger than 200px and smaller than 40px, so they can be in any size between 40 and 200 px.


PHP Code:
<div id="fotobook-photos-widget">
  <?php foreach($photos as $photo): ?>
  <div class="thumbnail" style="height: <?php echo $size ?>px; width: <?php echo $size ?>px">
   
      <img src="<?php echo $photo['src'?>" alt="<?php echo htmlentities($photo['caption'], ENT_QUOTES?>" />
    </a>
  </div>
  <?php endforeach; ?>
</div>