Fix checkout and install imagemagick