Hi Emilio,
I wrote a blog on how to do exactly this, hope it helps.
https://medium.com/mendix/building-a-pluggable-widget-url-image-viewer-6fd423858137?source=friends_link&sk=629e2a74a42cd4080a7d155488737d81
make sure the props return the uri for this image . normally you can get the image path like this
http://localhost:8080/file?target=window&guid=3659174697238829&changeDate=1621827714263