why not something like (taken mostly from manual)
<body>
<?php
$handle=opendir('.');
while (false!==($file = readdir($handle))) {
if ($file != "." && $file != ".." && preg_match( '/.jpg/i',$file) ) {
echo "<img src=$file width=100 height=100>\n";
}
}
closedir($handle);
?>
</body>
it doesn't look that nice, but it's easy and it works