Checking for JPG in a For Loop

I would like to check to see if a JPG exists before I load it. Is there an elegant way to do this?