Improved upload error handling.
Fix the bug when upload without image.