The law doesn't protect your image, it protects your biometric information.
To extend your flawed analogy, a photographer isn't allowed to take a gigapixel photograph of someone in public and then use the data from their fingerprints or iris to uniquely identify them.
I look at a photo, my brain tells me the photo is of "Bob", he's caucasian, male, with brown eyes. I enter this information in a spreadsheet.
Google algorithm looks at a photo, algorithm tells me the photo is of "Bob", he's caucasian, male, with brown eyes. I enter this data in a spreadsheet.
All Google has done is automate a process we were already capable of doing manually.
Edit - in my mind, the problem/question is people using photos commercially (or granting Google the rights to use commercially) photos they don't have legal rights to use that way. This would mostly apply to photos taken in private places. Photos taken in public can usually be used commercially by default.
This is a wrong assumption to make. What if the photos were clicked in my house? In a private gathering?
Normally, you don't have much expectation of privacy in public spaces. Generally, a photographer is free to take photos in public and use those photos as they see fit. Why is Google's use of your photo different than the photographer's use of the photo?