<?php
   $files = glob("*.{jpg,png,gif}", GLOB_BRACE);
   $max_files = count($files);
   $MAX_FILES = 200;
   if ($max_files > $MAX_FILES)
   {
   	$max_files = $MAX_FILES;
   }
   for ($i = 0; $i < $max_files; $i++) 
   {
      $image = $files[$i];
      $link = substr($image, 0, strlen($image)-4).'.tif';
      // echo "$link";
      //echo "<a href='$link' target='blank'><img src='$image' alt='$image' width=200></a> &nbsp;";
      echo "<a href='$image' target='blank'><img src='$image' alt='$image' width=200></a> &nbsp;";
   }
?>
