Automatically add repositories in the image directory and its parents.