obviously it has nothing to do with php, bbbuuuuttttttt
i got the same problem with my paint, just type this when you save "filename.jpg" and save it at 24-bit bitmap, leave the quotes when you do it, too
it will be the size/quality of a bitmap, but will be recoginzed as a jpeg, you will need to get some sort of image optimizer (i used ulead photoimpact 5) the shrink the size down, otherwise it will be huge