Match the size of an image

I have 2 images: SourceImage and TargetImage. I want the width of TargetImage to match the width of SourceImage.

This is the RectTransform of the source image:
5604376--579781--Screen Shot 2020-03-17 at 1.10.36 PM (1).png

I tried this but it sets the width to 0

I also tried this but the size is wrong:
5604376--579787--Screen Shot 2020-03-18 at 5.05.25 PM.png

How can I get the width of TargetImage to match the width of SourceImage?

Did you mean to get the RectTransform size or the Image size? If the latter, you should be getting the Image component.
It looks like your rect is size 0?

Yes. It is zero.

I want to get the current size of the SourceImage related to the current screen resolution. The SourceImage changes size because of the screen size.