Error handling for image loading.