500 internal error if files has write permission in the group

I have a PHP site, which allows me to upload pictures.
There's no trouble uploading the file, but the the file permissions on the picture is not "read by all groups", and the result is that i can't view the file in a browser.
My first thought was the give the uploading PHP file permissions to write, but when i do that, i get an internal error 500.

Your problem is not the permissions of the upload script, your problem is that the upload script sets wrong permissions for the uploaded image file. Your upload script must contain a chmod command to set the permissions of the uploadedc image file correctly.