Thank you, bunk58, and excuse me for being late with my answer - GoogleMail marked MODx motify mail as spam
In the meantime I found a solution. You just hove to name the TVs according zo this scheme: image1, image2 and so on. In the example the last image TV has the number 20.
<?php
for ($x = 1; $x < 21; $x++) {
$foto = $modx->getTemplateVarOutput(array('NAME OF THE IMAGE TVs'.$x));
if (!empty($foto['NAME OF THE IMAGE TVs'.$x]) && file_exists(MODX_BASE_PATH.$foto['NAME OF THE IMAGE TVs'.$x])) {
echo '<img src="[*bild'.$x.'*]" title="[*NAME OF THE IMAGE TVs'.$x.'*]" width="CHANGE THIS" height="CHANGE THAT" />';
}
}
?>