public static function createInstance($path, $driver=self::DRIVER_GD)
	{
		//validate driver
		if (!in_array($driver, static::$ALL_DRIVERS)) {
			$msg = Yii::t('app', 'Invalid driver \'{driver}\'! Allowed drivers are: {drivers}', [
				'driver'=>$driver,
				'drivers'=>implode(', ', static::$ALL_DRIVERS)
			]);
			throw new InvalidCallException($msg);
		}

		//try to create instance
		if ($driver === self::DRIVER_GD && ServerConfig::extGdLoaded()) {
			return new ProgressiveImageGd($path);
		} else if ($driver === self::DRIVER_IMAGICK && ServerConfig::extImagickLoaded()) {
			return new ProgressiveImageImagick($path);
		} else {
			$msg = Yii::t('app', 'The requested driver is \'{driver}\' but the corresponding extension is not loaded', [
				'driver'=>$driver,
			]);
			throw new InvalidConfigException($msg);
		}
	}