UI Image and Scripting Question

Not sure if this would be better here or in the UI section so I just flipped a coin LOL. I have a sprite renderer (on characters) sprite that I would like to use as a button’s image sprite (this would be for a party selection menu). I need this to be done programmatically as the button will be in a menu and the characters would be different during different parts of the game. I think I may be accessing/setting the images in the wrong way. I can set the image in the mock up by dragging and dropping easily enough.

This is what I want…
9580237--1356385--upload_2024-1-13_21-35-16.png

to be used here.
9580237--1356388--upload_2024-1-13_21-36-5.png

This is how I have attempted to do it.

I am aiming for this way to hopefully keep the color change.

GetAvailableMemberSpriteImages() is a serializedfield if that makes any sense.

Any advice or am I going to have to find another way to accomplish this?

Update: after a bit of playing around I found that my method actually did work as intended, it just was not complete. It seems obvious to me now, but since I was setting the new image to be the same as the old, it just appeared as if it was doing nothing as I was not also changing the color as well.

Also, I am not finding a way to delete this thread so I am assuming maybe that is not allowed? Just wondering so I don’t contribute to clogging up the forums with… Useless posts, after I find that my question was just an obvious mistake on my own part.