diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html
index 9957c21..eef90e0 100644
--- a/layouts/shortcodes/img.html
+++ b/layouts/shortcodes/img.html
@@ -1,16 +1,27 @@
{{ $img := $.Page.Resources.GetMatch (.Get "src")}}
+{{ $name_splitted := split $img.RelPermalink "." }}
+{{ $name_base := index $name_splitted 0 }}
+{{ $ext_base := index $name_splitted 1 }}