Add error handling when QImage::load fails.