fixed the file upload errors, now shows more details if an error occurs, fixed up some minor upload.php issues, added comments