Photos can't be removed after macos reinstall
I have some photos on my iphone X that were (some time ago) synced by finder from my macbook. After a while I had to repair the macbook and erased all my personal data from it before I gave it to the vendor.
It seems now that I'm stuck with a bunch of photos that I can't delete on my iphone, but my macbook doesn't recognize them as imported from that device (so disabling photo syncing and clicking "sync" does not change the status of them).
Please advice how I can delete, or at least how I can turn them into photos owned by the iphone, not synced.
iPhone X, iOS 16