Looks like the repeat selection behavior was applied outside of the repeat region behavior.
change line 241:
<?php } while ($row_rsImages = mysql_fetch_assoc($rsImages)); ?>
to:
<?php $RepeatSelectionCounter_1++; ?>
<?php } while ($row_rsImages = mysql_fetch_assoc($rsImages)); ?>