Refactor image matching to be a little cleaner and easier to improve.