protected function build($text)
{
preg_match_all('/src="([^"]+)"/', $text, $matches);
$urls = $matches[1];
$items = array();
foreach ($urls as $url) {
// Collect into to items array
$items[] = array('URL' => $this->maybe_bundle_source($url));
}
$this->json = array('role' => $this->get_setting('gallery_type'), 'items' => $items);
$this->set_layout();
}