added console.log to check why the image is not uploaded.