diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html
index 48ad5ebf..834e3a12 100644
--- a/layouts/partials/templates/opengraph.html
+++ b/layouts/partials/templates/opengraph.html
@@ -8,7 +8,7 @@
{{- else}}
{{- end}}
-{{- end }}
+{{- else }}
{{ with $.Params.images }}{{ range first 6 . -}}
{{ end }}{{ else -}}
@@ -21,6 +21,7 @@
{{- with $.Site.Params.images -}}
{{ end }}{{ end }}{{ end }}
+{{- end }}
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
{{- if .IsPage }}
diff --git a/layouts/partials/templates/schema.html b/layouts/partials/templates/schema.html
index e01dc483..6c032b66 100644
--- a/layouts/partials/templates/schema.html
+++ b/layouts/partials/templates/schema.html
@@ -11,7 +11,7 @@
{{- else}}
{{- end}}
-{{- end }}
+{{- else }}
{{ with $.Params.images }}{{ range first 6 . -}}
{{ end }}{{ else -}}
@@ -24,6 +24,7 @@
{{- with $.Site.Params.images -}}
{{ end }}{{ end }}{{ end }}
+{{- end }}
diff --git a/layouts/partials/templates/twitter_cards.html b/layouts/partials/templates/twitter_cards.html
index 2b3b7c96..de86c781 100644
--- a/layouts/partials/templates/twitter_cards.html
+++ b/layouts/partials/templates/twitter_cards.html
@@ -5,7 +5,7 @@
{{- else }}
{{- end}}
-{{ end }}
+{{- else }}
{{- with $.Params.images -}}
@@ -25,6 +25,7 @@
{{- end -}}
{{- end -}}
{{- end }}
+{{- end }}
{{ with .Site.Social.twitter -}}