Photo upload error handling + clean up code