handle image errors