There's a built-in duplicate-photo detector that automatically finds duplicate photos or videos on the Photos app in macOS Ventura and later versions, allowing you to merge duplicate images and keep those with the highest quality.
If your Mac can be upgraded to one of such macOS releases, you can do the upgrade to take advantage of the feature.
Otherwise, you may need to employ a different third-party duplicate photo finder to remove the duplicates.
If you also store photos in folders, you can easily get rid of the duplicates with a tool like iBoysoft MagicMenu. It's a right-click menu enhancer that allows you to perform various essential tasks by right-clicking on a Mac, including locating and deleting duplicate photos in a folder.
Give it a try by downloading it from the button below.