What you reccomended above... is what I thought and was playing with the past couple days. However, I was corrected and also looked at GD.pm only to find there is no newFromJpegData, also, it seems that it only wants a file handle.
If you check under my nodes, there is several replies when I was working on trying to figure out the newFromJpegData problem.