You’re very welcome, Mike.
You say you have to work with the image – regardless. Not my suggestion, and not my intention by sending the file to you, just to be on the same side with that.
I know that I’m always too picky with this stuff, but trouble way back in time with clients lead me to share this, there are limitations of what can be “healed” in C4D.
Please keep in mind that any changes on the perspective of the image, if not recognized, will lead to problems. Even the file that I have send you works to a certain or larger degree, I would write a memo to the source/provider that this is not ideal and might harm the quality. To make that point more clear, there is an “idea” of transforming an image in Photoshop and have it straightened; This might ruin its usability completely, not only its quality. Even the Film Offset X or Y can’t help that in some cases.
As mentioned, if you don’t work from the original output of the camera, with all information needed, some alterations can’t be simulated in Cinema 4D.
To your question about the X, Y or Z direction. Well, that is completely up to you. The only rule that exist, if the selected edges of objects are not 90º to each other, you get wrong results. The designation of X, Y or Z is an Artist decision. Note that not everything is parallel or in 90º, the gutter of every house is by design not horizontal, for example. Which is a common mistake, hence why I mention it.
My best wishes for your project