<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
  xmlns:bk2k="http://typo3.org/ns/BK2K/BootstrapPackage/ViewHelpers" data-namespace-typo3-fluid="true">
<f:if condition="{files}">

  <f:variable name="imagecols">{data.imagecols as integer}</f:variable>
  <f:variable name="columnConfig">{settings.gallery.columns.{imagecols}}</f:variable>
  <bk2k:data.imageVariants as="variants" variants="{variants}" multiplier="{columnConfig.multiplier}"
    gutters="{columnConfig.gutters}" corrections="{columnConfig.corrections}" />

  <div class="gallery-row">
    <f:for each="{files}" as="file" iteration="fileIteration">
      <div class="gallery-item {columnConfig.class}">
        <f:render partial="Media/Type" arguments="{file: file, data: data, settings: settings, variants: variants}" />
      </div>
    </f:for>
  </div>

</f:if>

</html>
