Turns out this isn't right because images_dir and styles_dir are expanded to absolute file system paths, which isn't very useful for making a uri to an image. We probably need a test for an image in a document to verify the correct behavior.