Handle images with base path urls, e.g. /img/foo.jpg

Additionally ImageMagick/GraphicsMagick errors are handled more robust.