Better error handling for image requests