handle error in uploading img