diff --git a/layouts/partials/photo-gallery.html b/layouts/partials/photo-gallery.html
new file mode 100644
index 0000000..7b7c0a1
--- /dev/null
+++ b/layouts/partials/photo-gallery.html
@@ -0,0 +1,40 @@
+{{/*
+Partial: photo-gallery
+Usage: {{ partial "photo-gallery" (dict "page" . "directory" "images" "id" "my-gallery") }}
+Usage shortcode: {{< photo-gallery directory="images" id="my-gallery" >}} ou {{< photo-gallery "images" "my-gallery" >}}
+- page: (obligatoire pour ressources de page) le contexte de la page (.)
+- directory: (optionnel) répertoire des images relatif à assets/ ou aux ressources de la page
+- id: (optionnel) ID HTML pour la galerie
+*/}}
+
+ {{ $images := slice }}
+ {{ if .directory }}
+ {{ $path := .directory }}
+ {{/* On essaie d'abord via resources.Match (pour les fichiers dans assets/) */}}
+ {{ $images = (resources.Match (printf "%s/*" $path)) }}
+
+ {{/* Si on ne trouve rien et qu'on a un objet .page, on cherche dans les Page Resources */}}
+ {{ if and (not $images) .page }}
+ {{ $images = .page.Resources.Match (printf "%s/*" $path) }}
+ {{ end }}
+ {{ else if .page }}
+ {{ $images = .page.Resources.ByType "image" }}
+ {{ end }}
+
+ {{ range $images }}
+ {{ if (and (ne .MediaType.MainType "image") (ne .MediaType.SubType "svg")) }}
+ {{/* On ne traite que les images */}}
+ {{ else }}
+ {{ $thumbnail := . }}
+ {{ if ne .MediaType.SubType "svg" }}
+ {{ $thumbnail = .Fill "300x300" }}
+ {{ end }}
+
+
+
+ {{ end }}
+ {{ end }}
+
diff --git a/layouts/partials/talks/event.html b/layouts/partials/talks/event.html
index ebe2a39..e6b6042 100644
--- a/layouts/partials/talks/event.html
+++ b/layouts/partials/talks/event.html
@@ -18,56 +18,6 @@
{{ if .pictures }}
- {{ $pageResources := $.Page.Resources }}
- {{ $picturesDir := .pictures }}
-
- {{ $images := $pageResources.Match (printf "%s/*" $picturesDir) }}
-
- {{ $totalImages := len $images }}
-
- {{ $remainingImages := len $images }}
-
-
-
- {{ range $image := first 3 $images }}
- {{ $resized := $image.Resize "900x webp" }}
-

-
- {{ $remainingImages = sub $remainingImages 1 }}
-
- {{ end }}
-
-
- {{ if lt $remainingImages 3 }}
-
-
- {{ range $index, $image := last $remainingImages $images }}
- {{ $resized := $image.Resize "900x webp" }}
-

- {{ end }}
-
- {{ else }}
-
-
- {{ range $index, $image := slice (index $images 3) }}
- {{ $resized := $image.Resize "900x webp" }}
-
-

-
- {{ end }}
- {{ $remainingImages = sub $remainingImages 1 }}
-
-
-
- {{ range $index, $image := after 4 $images }}
- {{ $resized := $image.Resize "900x webp" }}
-
-

-
- {{ end }}
-
- {{ end }}
-
+{{ partial "photo-gallery" (dict "page" $.Page "directory" .pictures "id" "gallery" ) }}
{{ end }}
{{ end }}