Correctly examine path for relative links in file module

Fixes #7515
Fixes #7537