public static function getTypeFromExt($ext) {
        if (isset(self::$_types[$ext])) {
            $mime = self::$_types[$ext];

            if (is_array($mime)) {
                $mime = $mime[0];
            }

            return $mime;
        }

        throw new InvalidArgumentException(sprintf('Invalid extension %s', $ext));
    }