{{- $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 -}}
{{ if not site.Params.image_sizes.design_system.lightbox.disabled }} {{ end }} {{ 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 }} {{ end }} {{ if or .text .credit }}
{{ if .text }}

{{ partial "PrepareText" .text }}

{{ end }} {{ if .credit }}
{{ partial "PrepareText" .credit }}
{{ end }}
{{ end }}
{{- end -}} {{ end }} {{ end }} {{- if $is_carousel }}
{{ end -}}