updated logic for image root