make it work with only 1 ref image