Better image error detection