Recognize basePath when calculating resource URLs for images