public static function createImageSetFromPostValues($postValues)
    {
        if (isset($postValues['title'], $postValues['width'], $postValues['height'], $postValues['method'])) {
            $imageSetObject = new \stdClass();

            $imageSetObject->title = $postValues['title'];
            $imageSetObject->slug = StringUtil::slugify($postValues['title']);
            $imageSetObject->width = $postValues['width'];
            $imageSetObject->height = $postValues['height'];
            $imageSetObject->method = $postValues['method'];

            return $imageSetObject;
        } else {
            throw new \Exception('Trying to create image set with invalid data.');
        }
    }