Having painstakingly deleted hundreds of unwanted photos, dare I re-sync another Mac to iCloud that still has many of the deleted ones? I have already deleted hundreds of photos in iCloud, and this works fine on my iPhone and Macbook.
However, I also have an IMac which WAS synced to the other machines up till 2017. This means in Photo it  has all the photos I ever took up to 2017 including the hundreds that I have carefully deleted from iCloud.
I want to set it so it syncs to iCloud again. But if I do, will the deleted photos get added back into my Photos from this IMac? So wasting the many hours of filleting.
Is there any risk of this? Is there anything I can do?
Should I actually delete all the photos from the IMac before syncing? Would this run the risk of deleting them all from iCloud once I sync (I would not want to risk that!).
I have checked other questions but this seems to be new.  My question is the opposite of many others I see, when people cannot get deleted photos to sync to another device.
Its an old iMac using OS X Yosemite 10.10.5
Thanks for advice.
There’s no risk if you have a backup. Cloud syncs, just like RAID are not backups.
I’ve had very good experience with Apple tracking when I delete files from a fully health sync setup. Adding a new device to sync generally wants to combine all.
Also - look at a tool that can easily clean duplicates if you run into this situation often.

https://fatcatsoftware.com/powerphotos/

If you want to be safe, set up a new photo library or export all the photos before you start. Designate the empty library as the system one and then go slowly once you’re sure the sync is solid.

https://support.apple.com/en-us/HT204414