Fix check of escaped internal uris

For now, we compare the filename with a maybe escaped one from the uri. This obviously can't work if it appears to be escaped.