Its possible - the only thing you need to decide is whether you need your thumbnail an actual reduces physical size of the original image. If you do you will need a third party extension for PHP - usually GD is used for this type of thing. You could however just set size constrains on the original image.
The looping and reading of the directory is quite simple as as the linking - but you need to make the above decision.
looping and printing your directory:
$dir = opendir("/images"); // or whatever you directory is
while ($file = readdir($dir)) {
echo '<a href="'.$file.'" target="_blank">'.$file.'</a><br>';
}
closedir($dir);
you could pretty this up by adding the contents to an array and sorting it in alphabetical order, you could also remove the file extension.
Hope this help slightly 🙂