fix next-image to use directory of the filename instead of the current one