Hi!
My guess is that you need to open those files in binary mode in a regular text editor and see if there's a different pattern in animated and regular gif images. Usually you have to look at first few bytes of the file.
Most image type getting functions just read first two-three bytes, and return the type of the image. Gif usually has GIF89 string at the beginning.
I don't really know. It seems to me the animation information may be just as well buried past those few bytes. In this case, you could use regexp to find the pattern, but as you may guess this will be quite a time-consuming process.
Best,
Stas