Fixed image upload error paths