Handle ImageMagick errors more gracefully

In particular when Photoshop does not pass a straight number for the DPI.

Addresses (but doesn't fix) #70.