Hi,
The Messages app has issues with Multiple active account in Contacts App > Preferences > Accounts
It is immaterial if you have the Bonjour Account active (the Buddy List is populated only when other computers are on line) or the AIM or Jabber options (Google is a Jabber server that does not follow "the rules" in Server naming so has a different entry option).
There has been an issue in the past where this uncertain Contacts app (where it is constantly cycling all the Address Book and Contacts from wall the services that can run an address book and never getting to the end.
More recently there seems to be a change on how the Messages app decides on where it is and what Country code number should be using.
Previously it was manually entered in the app. At El Capitan it seemed the OS polls the networks it can see to determine where the Mac is (and Messages no longer has a Locations setting)
This seems to mean that items in your Contacts list that do not use a Country Code on the Number don't match to the names for some reason.
I understand that people that have this issue still see the correct picture for the Contact.
This pic is from an early version of Messages

The Sign Out process was different and the slide out pane was used when choosing the Country.
This would prefix numbers with the Country Code.
There now seems to be a difference to what El Capitan was doing to find out the Country and how Messages accessed it compared to at least how OS X 10.12.4 and upwards seem to do it.
I don't remember specifically adding the Country Code to all my GB Contacts but I may have done so when I went to France two years ago.
My list to change is really small as I was using AIM a lot more than I used iMessages at the start.
I don't know if there is a quick way to do it.

8:37 pm Saturday; June 10, 2017
iMac 2.5Ghz i5 2011 (Sierra)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
iPhone 6 iOS 10.x and an iPad (2)