Handle image failing to load

Add an error callback, so we can handle a situation when there is no image specified or an image fails to load.