Image resizing is not properly performed in Go JS

I have requirement uploaded the image and resizing the image. it should be resize as per aspect ratio of image. please provide your suggestion. please find the code your reference.
$$(go.Node, “Auto”, { selectable: false },
new go.Binding(“location”, “loc”, go.Point.parse).makeTwoWay(go.Point.stringify),
$$(go.Part, “Viewbox”,
{ resizable: true },
$$(go.Panel, “Auto”,
$$(go.Picture,
{
sourceCrossOrigin: function (pict) { return “use-credentials”; },
//width: 40, height: 40,
imageStretch: go.GraphObject.UniformToFill,
maxSize: new go.Size(200, 200),
//angle: 30,
},
new go.Binding(“source”, “path”),
new go.Binding(“width”, “imageWidth”),
new go.Binding(“height”, “imageHeight”),
new go.Binding(“imageStretch”, “imageStretchOption”),
new go.Binding(“desiredSize”, “imageDesiredSize”),
new go.Binding(“maxSize”, “imageMaxSize”))
)
));

but currently image not resized properly.

Are you sure you want to use UniformToFill stretching? That might result in clipping. GoJS Pictures -- Northwoods Software

Or are you asking about something else? If so, please show an annotated screenshot pointing out the problem, and show us how you would want it to be otherwise.