<?php
	$gallery_items = '';

	foreach($instance['gallery_item'] as $item) {
		$image = $item['image'];

		if( $item['image_fallback'] ) {
			$image = $item['image_fallback'];
		}

		$gallery_items .= '[gfxbucket_gallery_item caption="' . $item['caption'] . '" image="' . $image . '" /]';
	}
	
	echo do_shortcode('[gfxbucket_gallery columns="' . $instance['columns'] . '" size="' . $instance['size'] . '"]' . $gallery_items . '[/gfxbucket_gallery]');
?>