private function getConstraint(array $config)
    {
        $options = array(
            'maxSize' => '5M',
            'mimeTypes' => $config['mime_types'],
            'maxHeight' => $config['max_height'],
            'maxWidth' => $config['max_width'],
            'minHeight' => $config['min_height'],
            'minWidth' => $config['min_width'],
        );

        return new Assert\Image($options);
    }