Show proper error message when image upload fails

fixes #994