Fix error when adding valid children to media elements