protected function makeGalleries(array $matches, array $idSets, $text)
    {
        foreach ($idSets as $key => $ids)
        {
            $slides = get_nuclear_gallery($ids);

            $gallery = (count($slides)) ? $this->makeGalleryHTML($slides) : '';

            $text = str_replace($matches[$key], $gallery, $text);
        }

        return $text;
    }