<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">1</f:variable>
    <f:if condition="{files -> f:count()} > 1">
        <f:variable name="imagecols">{data.imagecols as integer}</f:variable>
    </f:if>
    <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}" />
                
                <f:if condition="{data.layout} == 25">
                    <div class="image-subline">
                        <h1>
                            <span class="element-header">{data.header}</span>
                            <span class="element-subheader">&#8203;{data.subheader}</span>
                        </h1>
                    </div>
                </f:if>
            </div>
        </f:for>
    </div>

</f:if>
</html>

