Check the layout before including images and sound in the DOM

Issue edina/fieldtrip-gb#141