I have used @DrNufer's code from https://www.howtocanvas.com/create-amazing-pages-in-canvas/background-css to successfully use an image in a Canvas course. Please try this code and you will get a result that is similar to what is in the screenshot provided below.
<div style="background: url('/courses/COURSE_ID/files/FILE_ID/preview') no-repeat center; align-items: center; display: flex; justify-content: center; height: auto; width: auto;">
<div style="background-color: rgba(255, 255, 255, 0.4); padding: 20px; margin: 30px;">
<p style="text-align: center;"><span style="font-size: 14pt;"><strong>This is my new Canvas page that I am making on 2025-09-14.</strong></span></p>
</div>
</div>

After you get that result, you would be able to use other code that @DrNufer provides.
Something to note and I tried this: When copying/import from one course together another (and I tried the different ways that Canvas supports), you will need to manually change the source for where the image is located because the Canvas copy/import process does not automatically change the source because it was manually added.
-Doug