{#each photos as photo}
{photo.altText} {#if credit} {@render credit(photo)} {:else if photo.credit} {photo.credit} {/if}
{/each}
{#if photos[activeImageIndex].caption} {@const activePhoto = photos[activeImageIndex]} {#if caption && activePhoto.caption} {#key activeImageIndex} {@render caption(activePhoto)} {/key} {:else if typeof activePhoto.caption} {#key activeImageIndex}

{activePhoto.caption}

{/key} {/if}
{/if}