Make support for images in docs more robust

Images in subdirectories of the package root will now have the
information about their location in the hierarchy preserved, in the
filename they're given. Links to these images are adjusted to refer to
the new filenames.

This ensures that references to images in other directories than that of
the referencing markdown will be valid.