Issues drawing an image onto a canvas

Hello! Recently I’ve been messing around with files in JavaScript, because I’m building a little animation app for testing purposes.

In any case, a feature I want to add to it is upload an image as a frame (since I am NOT animating Bad Apple by hand).

The idea is you upload an image, it gets drawn onto a canvas, and then the canvas API is used to retrieve the image data.

Sadly, however it is not working.

Any help is appreciated!

https://codepen.io/c0d1ng_ma5ter/pen/gbPXbJb?editors=0100