Php jpgs getting corrupted

hey everyone,

i created an upload script to upload jpgs on my local network. i store the filename into a database. i then read the database for all the jpgs filenames, and create links from them. however, they look corrupted when i view them through IE.

when i view them this way:
the image looks corrupted

when i open the same file in ps7 or other image programs, they look fine.

anyone ever encounter this problem?