Suggestion, to standardize, it makes sense to convert over to a 7 pin round pattern. It's what all the newer rigs and trailers seem to come with. You can get the socket side pretty inexpensively, with a bracket as well. You can also get the 7 round AND 4 flat in one fixture, but I don't see the point, it's easy enough to wire up the 7 round. Plus, as I've planned with my little boat if ever completed, I can use one of the pins to charge the boat battery while I'm towing.
My trailer had four flat, but when someone else wanted to use it, or I wanted to tow someone elses trailer, we'd have to have the adapter (which always get lost apparently, part of the function of them? lol), hope they were wired right, etc. By going with the 7 round on the truck and trailer, I've eliminated that problem.
With wiring like your pic, I'd strongly suggest completely redoing it. The four wire weatherpack to flat four trailering adapters are easy and cheap to find, cut the four flat off and run it to the 7 round socket. Unfortunately, the wiring jackets are damaged, those scotchlocks are garbage (IMO), and at some point, that is going to cause issues. At worst cut the wires, install shrink tube, and splice the wires back together to try and seal it all up, or cut it all off, and wire in a new pigtail. Just a suggestion. Hacked trailer wiring is the reason for many trailer/truck lights not working right, and is a major cause of standalone truck lighting issues.