public static function getClass($type)
{
if (!static::isAvailable($type)) {
throw new \Exception("Invalid image format '{$type}'. " . "Allowed formats are: " . implode(', ', static::available()));
}
$className = static::$typesMap[strtolower($type)];
return new $className();
}