Echo out the mimetype ($_FILES['userfile']['type'] and see what it's coming up as.
header("Location: main.php?success=New picture has been has been added to row. Please complete the rest of the fields");
Also, this line doesn't mean anything. It will just confuse the browser, since you haven't specified protocol, server, or any of the other needed parts to a URI. I always have to ask myself, "why do people send Location headers without a full URI?"...
Note: this goes for all of your header()s, not just the last one.