Fix imagemagick errors hanging instead of raised

Fixes #231