handle invalid image upload
API image uploading cleaned up