Setting Canvas Slot SetSize to exact Pixel Value

Using the UI system, I have an Image that is set programtically so it will have different resolutions. I want to “best fit” that image on the UI.

My general solution is 1) get Screen resolution, 2) get Image resolution 3) Set Image Canvas Slot setSize to the “scaled” version of that

Sometimes I want to leave the image EXACTLY native resolution on the screen.

Problem is Screen units and Canvas units dont seem to align exactly. I am not sure how to get the Screen resolution exactly right for the Canvas. Canvas Desired Size isnt quite right. How can I achieve this?