How can I use the "image" endpoint and get the correct image orientation

Hi guys,

I’m trying to use the “/api/cockpit/image” endpoint to get a lighter version of the uploaded asset images but when I append them to my page they lose their orientation. Every image is either sideways or upside down. How can i get them to preserve their orientation?

Context: i use the “/api/cockpit/image” endpoint on cockpit and i specify the asset id and the height:

{
    "src": "128f0ed03064308b580002da",
    "h": "540"
}

Thank you