fix photo upload bug