aafig: Fix HTML builder rendering
aafig: Fix HTML builder rendering

The HTML builder has no 'imgpath' attribute when the Sphinx event
"doctree-read" is triggered, making aafig fail to detect HTML builder is being
used.

This patch properly detects the HTML builder (and others) and properly handles
subdirectories, using the env builder attribute to find out the relative
location of the document.

Thanks to Vadim Gubergrits for the bug report, analysis and suggestion about
the use of sphinx.util.relative_path().

sphinx-contrib/spelling,sphinx-contrib/spelling