How does image matching work?