epub: fix file resolution in some contexts