Add support for Imagick if present

Imagick is faster and more memory efficient than GD but less commonly installed. This uses Imagick if present otherwise falls back on GD. This may help reduce out of memory errors on larger images.

The diff is deceiving the only code changed/added is:

if(!class_exists("Imagick")) {
	...
} else {
	$image = new Imagick();
	if ($crop) {
		$image->setSize($finalWidth, $finalHeight);
		$image->readImage($originalPath);
		$image->cropThumbnailImage($width, $height);
	} else {
		$image->setSize($width, $height);
		$image->readImage($originalPath);
		$image->thumbnailImage($width, $height, true);
	}
	if($image->getCompression() == imagick::COMPRESSION_JPEG) {
		$image->setCompressionQuality($this->jpegCompression);
	}
}