How to add an Image to the slot of a widget in C++?

Hi, I’ve created a C++ class MyWidget derived from UUserWidget and added a variable UImage *MyImage.

What I would like to do is, when I create a child widget of MyWidget, the child widget already has the image added to the default slot. But for now, the image appears in the details panel but it doesnt appear in the designer part of UMG.

Is there a way to add the image to the slot just by using C++? Of course I could add the image directly in UMG but I would like to be able to do it using only C++.