Fixed path-related problems on windows.

Added substitution of slashes in paths on windows machines - before, the
backslash was not unescaped in the templates and caused the images not
to be shown.