Have a try and define a master:
PhotoImage(master = canvas, width = WIDTH, height = HEIGHT)
If you do not define a master then this image uses the first Tk()
which is created and if that Tk
is deleted there is no image to display.
Tell me if it works, I am guessing.