First of all, do you know how to fetch files in a directory ? If not have a look there and particularly here
Well then for each file, I need to know a little bit more about your requirement. Do you have exactly the same pattern for each image file. I mean is it only the number that can change image.xyz.tga ? ? or do you have different name or different extension like image.xyz.gif or toto.xyz.bmp
If the pattern is always the same, you will want to use this and if it's not you will prefer using Regular expression
Well tell us more