Fixes issues with GraphicsMagick and gif images. Fixes #163.