{{ $imageName := (index .Params 0)}}
{{ $subtitle := (index .Params 1)}}
{{ $newSize := (index .Params 2) }}

{{ $imageDict := partial "getScaledImage.html" (dict "imageName" $imageName "newSize" $newSize) }}

{{ $originalImage := $imageDict.originalImage }}
{{ $scaledImage := $imageDict.scaledImage }}

<figure>
	<a href={{ $originalImage.Permalink }} target="_blank">
		<center>
			<img class="embedded-image" alt="{{ $subtitle | .Page.RenderString }}" src={{ $scaledImage.Permalink }}>
		</center>
	</a>
	<figcaption>
		<center>
			{{ $subtitle | .Page.RenderString }} ({{ printf "%.*f" 2 (div (len $originalImage.Content) 1000000.0) }}MB)
		</center>
	</figcaption>
</figure>
