Allow using imagemagick

Except for some automatically removed trailing whitespace, all I've added is the five lines at the top, which allows usage of imageMagick instead of graphicsMagic. This because gm is not supported on Heroku (using a free dyno).