This question has been answered by Bruno17. See the first response.
<?php
$images = $modx->fromJson($modx->getOption('images', $scriptProperties, ''));
$output = '';
if (is_array($images) && count($images) > 0) {
if (count($images) > 1) {
$scriptProperties['wrapperTpl'] = $galleryWrapperTpl;
$scriptProperties['tpl'] = $galleryTpl;
} else {
$scriptProperties['wrapperTpl'] = $imageWrapperTpl;
$scriptProperties['tpl'] = $imageTpl;
}
$output = $modx->runSnippet('getImageList', $scriptProperties);
}
return $output;[[yourSnippet? &galleryWrapperTpl=`yourGalleryWrapperTpl` &galleryTpl=`yourGalleryTpl` &imageWrapperTpl=`yourImageWrapperTpl` &imageTpl=`yourImageTpl` &images=`[[*yourMigxTV]]` &tvname=`yourMigxTV` ]]
[[snippetNameHere?
&galleryWrapperTpl=`galleryWrapperTpl`
&galleryTpl=`galleryTpl`
&imageWrapperTpl=`imageWrapperTpl`
&imageTpl=`imageTpl`
&images=`image`
&tvname=`teaser`
]]
galleryWrapperTpl
<div>
<ul>
[[+galleryTpl]]
</ul>
</div>
galleryTpl
<li>
<img src="[[+image]]" alt="[[+title]]" />
</li>
imageWrapperTpl
<div>
[[+imageTpl]]
</div>
imageTpl <img src="[[+image]]" alt="[[+title]]" />
<div>
<ul>
[[+output]]
</ul>
</div>[[snippetNameHere?
&galleryWrapperTpl=`galleryWrapperTpl`
&galleryTpl=`galleryTpl`
&imageWrapperTpl=`imageWrapperTpl`
&imageTpl=`imageTpl`
&images=`[[*teaser]]`
&tvname=`teaser`
]]