Edited the photo upload code