Beginner - Seeking to create shortcut to pass photo and contact inputs to scriptable script that edits that contact’s image to the photo

Hi there,

This seems like a nice community and am seeking some direction as a beginner (with Scriptable and with Javascript in general), or if anyone has already made a project like this.

Ultimately, the end goal of this is to have a Shortcut that can change the contact image for a given contact. I want to be able to automate this in the background through the Shortcuts app. This will allow me to automate changing an image on my Apple Watch as a complication, since it appears that the Apple Contacts app is the only way to present a customizable image as a complication.

To do this, I believe the following is what I need to create:
The easy part:
-a shortcut that chooses a photo from my library and a contact from my contact app
The hard part:
-a script that takes the image and contact from the shortcut that the script will be within and edits the given contact’s image to the photo passed from the shortcut.

As far as I have figured out, this is all possible with the powers of Shortcuts and Scriptable, but I have yet to figure out how to build a script that can do it.