improved iframe height-setting algorithm