Added imagemagick and graph magick support plus osme refactoring