diff --git a/ws/Docbook/Preprocess/Xsl/docbook2html.xsl b/ws/Docbook/Preprocess/Xsl/docbook2html.xsl
index f6f493a2d1c1c53e10d4674ab33f620a48abcd21..473e121ad2a4839b2b83be9ad55b585b1b59b739 100644
--- a/ws/Docbook/Preprocess/Xsl/docbook2html.xsl
+++ b/ws/Docbook/Preprocess/Xsl/docbook2html.xsl
@@ -27,11 +27,11 @@
   </xsl:template>
   
   <xsl:template match="db:figure/db:title">
+    <xsl:variable name="slideContainerId" select="ancestor::*[contains(@annotations, 'slide')]/@xml:id"/>
     
     <title>
       <xsl:copy-of select="text()|*"/>
 
-      <xsl:variable name="slideContainerId" select="ancestor::*[contains(@annotations, 'slide')]/@xml:id"/>
       <xsl:if test="$slideContainerId">
         <xsl:text> </xsl:text>
         
@@ -85,7 +85,7 @@
       </xsl:if>
     </title>
     
-    <xsl:if test="ends-with(parent::db:figure/db:mediaobject/db:imageobject/db:imagedata/@fileref, '.fig')">
+    <xsl:if test="not($slideContainerId) and ends-with(parent::db:figure/db:mediaobject/db:imageobject/db:imagedata/@fileref, '.fig')">
       <para>
         <uri>
           <xsl:attribute name="xlink:href">
@@ -104,7 +104,7 @@
       </para>
     </xsl:if>
     
-    <xsl:if test="ends-with(parent::db:figure/db:mediaobject/db:imageobject/db:imagedata/@fileref, '.svg')">
+    <xsl:if test="not($slideContainerId) and ends-with(parent::db:figure/db:mediaobject/db:imageobject/db:imagedata/@fileref, '.svg')">
       <para>
         <uri>
           <xsl:attribute name="xlink:href">