Finally got imagemagick working