starting image match logic