Adding error handling for photo upload dialog