You would have to make sure that name isn't used by anything else on the page. Next, you would modify your call for your image button:
document.write('<iframe name="dynframe" id="dynstuff" src="" '+iframeprops+'></iframe>')
But, as I say, this will be a security violation and therefore prohibited. There may be some type of server side work around to the violation but, that is beyond the scope of my knowledge and would depend upon what (if any) server side languages you have available to you.