{{ $pic_set := .pic_set }}
{{ $caption := .caption }}

{{ $num_per_row := 3}}
{{ $max_width := 80}}
{{ if or (eq (len .pic_set) 2) (eq (len .pic_set) 4)}}
    {{ $num_per_row = 2}}
    {{ $max_width = 53}}
{{ end }}

{{/* Trim the caption length to the first 100 characters */}}
{{ $caption = $caption | truncate 100 "..." }}

<div class="pic-grid" style="width: {{ $max_width }}%">
    <div class="pure-g">
        {{ range $num, $a := $pic_set }}
            {{ if (not (strings.HasPrefix $a "http")) }}
      