Flash and jpeg

I’m having a problem importing certain jpegs into flash. I’m uploading the pics from an html form, which gets a php file and sends the pic to the appropriate location and creates a thumbnail of the pic. The thumbnail works fine, however, the php i’m using contains if(uploadedpic_type !=“image/pjpeg”){ echo “please choose a jpeg image”;} This is also working. HOWEVER, nearly every picture i try to upload (and yes i’ve checked their file extension to make sure they are jpeg or jpg) comes up saying “please choose a jpeg image”. I could take out the file check to upload the image anyways, but then when i try to import those images into flash, they won’t load. Its really confusing to me. I also have a question about changing the name of the jpg, to see if that might work. Is there a way to have the php change the name (ex. me and friend.jpg) to (meandfriend.jpg) eliminating the spaces? I’ve noticed that pics that don’t have spaces in the name do load, however, this is not always the case. Its a very confusing problem for me. I hope i didn’t make it more confusing than it should be! Sorry if its cluttered!!
Thanks in advance!