Is it possible to know the file name of images loaded?

Hi:

I have a folder containing some images named 01_image_name.jpg, 02_image_name.jpg, 03_image_name.jpg, … wich I read with a PHP script.
Then I loop loading each image and waiting until all are loaded to display them

The problem is I need to show them sorted by file name

Thanks in advance