Re-wrote UTIL.switchToFrame() to wait for frame etc..., added DOMs for Gallery.