modified handling of image paths