attempt to fix broken pipe exception while uploading photo
cleanup