It looks like the primary issue you hit was that the "Go to URL…" action doesn't target a specific iframe.
It appears that you have untitledFunction() that is some code that looks like it was attempting to solve this problem. It seems very close, you probably just need to make sure the right class names are assigned to the buttons and you have the right ID for the query selector.
However instead it looks like you went with an approach to use Inner HTML <a> tags to target the right iframe.
Given that, I would say that the easiest way to do the conversion would be to take the Inner HTML of your text buttons now, and paste that into the Inner HTML of the image buttons. Instead of the "Doc 1" text you can put in a div that fills up the inner space. It would look something like:
<a href="http://echo-boy.com/odds-i-frame.html" target="iframe_a"><div style="width:100%;height:100%"> </div></a>
Hmm... I'm not sure I see the particular problem, can you say which button to click to see a good and bad example of the centering?