this snippet reads a given directory and returns an array of the images found. gets some information about the images as well .

drop this in any directory and replace the path to the folder with ./ and specify the files you want to show.
you get a list of all files which mach the criteria.

download options for image handling / list image folder

you can download the source as PHP file,

open the file as plain text in a new window or

get the code in a textarea to copy it.