Replace link with iframe, else append might append below caption

I noticed this morning that if the interactive figure contains a caption, the boot script appends the iframe so it appears below the caption, rather than above.

@andymason @commuterjoy want to give this a look before I merge? It's a bit cumbersome to test changes to this script without deploying, annoyingly...