fix photo uploading bug