diff --git a/aafig/sphinxcontrib/aafig.py b/aafig/sphinxcontrib/aafig.py
index <HASH>..<HASH> 100644
--- a/aafig/sphinxcontrib/aafig.py
+++ b/aafig/sphinxcontrib/aafig.py
@@ -131,7 +131,10 @@ def render_aafig_images(app, doctree):
         # FIXME: find some way to avoid this hack in aafigure
         if extra:
             (width, height) = [x.split('"')[1] for x in extra.split()]
-            (img['width'], img['height']) = (width, height)
+            if not img.has_key('width'):
+                img['width'] = width
+            if not img.has_key('height'):
+                img['height'] = height
 
 
 def render_aafigure(app, text, options):
aafig: Don't override width and height for SVG images

If width or height options are already present in the figure, don't override
them with the width and height provided by the aafigure visitor.