diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html
index a950e86..3d07356 100644
--- a/layouts/shortcodes/img.html
+++ b/layouts/shortcodes/img.html
@@ -17,22 +17,13 @@
-
-
+
+
- {{ with $caption }}
+ {{ with $caption -}}
{{ . }}{{ with $source.Params.credits }} ({{ . | $.Page.RenderString }}){{ end }}
- {{ end }}
+ {{- end }}
{{ end }}