Fixed paths to files in generated html.

When I ran the test script, the paths in the index.html file inside each page directory were incorrect, and the links to the parent directories and the individual text-line images were broken. This patch corrects the links relative to the location of the index.html in which they're found. 

Originally, in the file /temp/0001/index.html, the links looked pointed to temp/0001/<img_name>. Because the browser resolves these relative to the current location, it tried to load a file from temp/0001/temp/0001/<img_name>, and failed.