photo upload function works locally