added references for photo upload
cleaned up js code
attempting to make js less flaky