Writes the image and video hooks.