Ray,
the code which reads the resolution of an image was contributed by Nico Prenzel. I do not know how the code works but I do not think it is reading EXIF information from the file.
I found that there are several JPEG files which do not work with this code, I am not absolutely sure but there seems to be a problem with JPEG files with progressive encoding. So if you save images try to avoid this.
I you have any idea how to read EXIF information from a file I will be happy to implement it.
Christian