ChatGPT's code is way BETTER than mine. I added a bit of fluff because I thought I would need to support multiple image filetypes at some point, and I was imprecise in using a few methods. I just asked the AI for feedback on my human code.