Move cloning of master pages into own method

Also:
* rename methods for more precision:
    setFramePosition -> setDrawElementPosition
    modifyImages -> modifyDrawElements
    getMasterPage -> getMasterPageElement
* move the var shadowContent into proper place