diff --git a/themes/red/layouts/partials/art-section.html b/themes/red/layouts/partials/art-section.html
index 854d7b4..7355ba3 100644
--- a/themes/red/layouts/partials/art-section.html
+++ b/themes/red/layouts/partials/art-section.html
@@ -12,8 +12,4 @@
{{ end }}
-{{ $site := resources.Get "js/gallery.js" }}
-{{ if hugo.IsProduction }}
-{{ $site = $site | minify | fingerprint | resources.PostProcess }}
-{{ end }}
-
+{{ partial "gallery-js" . }}
diff --git a/themes/red/layouts/partials/gallery-js.html b/themes/red/layouts/partials/gallery-js.html
index cb41b16..f7f7653 100644
--- a/themes/red/layouts/partials/gallery-js.html
+++ b/themes/red/layouts/partials/gallery-js.html
@@ -1,5 +1,17 @@
{{/* Partial used to include the JS for the gallery page's masonry layout. */}}
+{{ $masonry := resources.Get "js/masonry.min.js" }}
+{{ if hugo.IsProduction }}
+ {{ $masonry = $masonry | fingerprint | resources.PostProcess }}
+{{ end }}
+
+
+{{ $imagesloaded := resources.Get "js/imagesloaded.min.js" }}
+{{ if hugo.IsProduction }}
+ {{ $imagesloaded = $imagesloaded | fingerprint | resources.PostProcess }}
+{{ end }}
+
+
{{ $site := resources.Get "js/gallery.js" }}
{{ if hugo.IsProduction }}
{{ $site = $site | minify | fingerprint | resources.PostProcess }}
diff --git a/themes/red/layouts/partials/head.html b/themes/red/layouts/partials/head.html
index dab70b0..61613a9 100644
--- a/themes/red/layouts/partials/head.html
+++ b/themes/red/layouts/partials/head.html
@@ -27,18 +27,6 @@
- {{ $masonry := resources.Get "js/masonry.min.js" }}
- {{ if hugo.IsProduction }}
- {{ $masonry = $masonry | fingerprint | resources.PostProcess }}
- {{ end }}
-
-
- {{ $imagesloaded := resources.Get "js/imagesloaded.min.js" }}
- {{ if hugo.IsProduction }}
- {{ $imagesloaded = $imagesloaded | fingerprint | resources.PostProcess }}
- {{ end }}
-
-