This is a tricky problem to resolve and there are a few stategies you should know about.
1. Always check that links are appropriate before you start transcribing... As someone else pointed out recently the link button is hard to see when one is taking photos, and it is easy to get links where they should not be and no links when you think you did it.
2. When in doubt do not link, as it is easier to link later than to un-link, as you have found.
3. If you unlink, you have to then go to the photo that was unlinked and edit that record by making detailed corrections to all the lines attached to that photo. You also have to then also edit all the records attached to the original photo(s). If it is only one or two, this can be very simple by doing what someone earlier called a fake merge.
4. Example, two unrelated people were linked and transcribed. Unlink their photos, go back to the first one and edit the information for the second person to be an exact copy of the first person, and then refresh and open in Record screen and look for the Merge arrow. Merge and check that it is now correct.
5. After you have merged the first person's records, open the second image in a new tab or window, and again, "delete" the incorrect information by creating a duplicate entry for the second person. Again, refresh and open the record screen and merge the orginal and the duplicate.
6. If there are really multiple entries wrongly linked you can create even more of a mess by trying to merge too many things at a time. Just go slow and work on a few at a time. If you get a big mess (dozens of duplicate etc.) send a note back here with the URL for the links, and one of us more experienced volunteers will help you clean it up.
7. I actually look for these in cemetery cleanups and enjoy sorting them out, but it was not easy to learn how to do it quickly and I will say that I have spent more than 1 hour just working on a single badly grouped cluster. Wish we had better tutorials on the blog for this kind of thing. I don't know that anyone would figure it out on their own. We used to have a "sort-of" tutorial for this back in the old Community, bu that is no longer available to us. Alas.