upload_image func return None on error