fix error with photo upload