Even better error checking and test for corrupt image

svgo made me do it :(.
1.0.2