Cannot resize images and preserve good quality with imagemagick