{{- $is_carousel := false -}} {{ if gt (len .images) 1 }} {{- $is_carousel = true -}} {{ end }} {{- if $is_carousel }}
{{ end -}} {{ range .images }} {{ if .file }} {{- $image := partial "GetMedia" .file -}} {{- if $image -}}
{{ partial "commons/image.html" (dict "image" .id "alt" .alt "sizes" site.Params.image_sizes.blocks.gallery.carousel )}} {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} {{ $lightbox_text := false }} {{ if and .text .credit }} {{ $lightbox_text = delimit (slice .text .credit) " / " }} {{ else }} {{ $lightbox_text = or .text .credit }} {{ end }} {{ end }} {{ if or .text .credit }}
{{ with .text }}

{{ . | safeHTML }}

{{ end }} {{ with .credit }}
{{ . | safeHTML }}
{{ end }}
{{ end }}
{{- end -}} {{ end }} {{ end }} {{- if $is_carousel }}
{{ end -}}