It fixes #19239. When the canvas isn't existing the editor has no image: it's fine because the editor is invisible. Once it's made visible, the canvas is set when the annotation layer has been rendered.