updated photo loading scripts. changed order of upload and error handling.