add support for imagemagick/graphicsMagick

reduce extra logic and support imagemagick and graphicsMagick. 

Note enable debug mode in imagemagick durtpal module for extra debug info.