Fix errors when uploading product image/document