Added more error handling. Normalize error images.