Vector Graphics overlay on top of Image or Video element

Calling append() directly on the d3 object gives the error:

InvalidCharacterError: Failed to execute ‘createElement’ on ‘Document’: The tag name provided (‘[object HTMLImageElement]’) is not a valid name.

Here is the notebook: Image or Video with Graphical Overlay / benoit9 | Observable