The caption is a text description embbed in the jpeg. Its basically suppose to be a description of the image. Its part of a jpeg standard part of the IPTC Information. I found this
which had some information on it. I found a perl module
which does read captions from most of the files. Unfortunately it doesn't read all the jpegs neccessary for my tasks. The funny thing is the code I posted does get a caption if its there reguardless of what the jpeg format it was saved in. But some times if there is no caption, it just grabs a chunk of the jpeg. I've been trying to detect when it does that but it has been difficult.