added changes to photo upload functionality