How to make bootstrap carousel image responsive?

How to make bootstrap carousel image responsive?

I want to keep the same ratio of the images. The problem is it streches when the browser is wide.
and squezes when it’s reduced.
I have checked all SO question here but most of them did not help me.
Here is the markup: