diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
index f7d656fa5a..500fc908ed 100644
--- a/layouts/_default/_markup/render-image.html
+++ b/layouts/_default/_markup/render-image.html
@@ -3,5 +3,4 @@
"url" .Destination
"title" .Title
"alt" .Text
- "ordinal" 0
) }}
\ No newline at end of file
diff --git a/layouts/partials/make-random-md5.hugo b/layouts/partials/make-random-md5.hugo
new file mode 100644
index 0000000000..d355dde35d
--- /dev/null
+++ b/layouts/partials/make-random-md5.hugo
@@ -0,0 +1,8 @@
+{{- $random := "" }}
+{{- $set := split "012345abcdefghijklmnopqrstuvwxyz" "" }}
+{{- range (seq 16) }}
+ {{- with ($set | shuffle | first 1) }}
+ {{- $random = printf "%s%s" $random . }}
+ {{- end }}
+{{- end }}
+{{- md5 $random }}
\ No newline at end of file
diff --git a/layouts/partials/shortcodes/image.html b/layouts/partials/shortcodes/image.html
index 1807b8b00b..6b3aa9f291 100644
--- a/layouts/partials/shortcodes/image.html
+++ b/layouts/partials/shortcodes/image.html
@@ -2,7 +2,6 @@
{{- $url := .url }}
{{- $title := .title }}
{{- $alt := .alt }}
-{{- $ordinal := .ordinal }}
{{- $classes := slice }}
{{- $lightbox := true }}
{{- $height := "auto" }}
@@ -34,14 +33,14 @@
{{ $width = . }}
{{- end }}
{{- end }}
-{{- $fragment := printf "%d-%s" $ordinal ((trim (replace (replace (replace (replace (replace $url "=" "-") "&" "-") "?" "-") "." "-") "/" "-") "-") | safeURL | anchorize) }}
+{{- $id := partial "make-random-md5.hugo" }}
{{- if $lightbox }}
-
+
{{- end }}
{{- if $lightbox }}
-
+
{{- end }}
\ No newline at end of file