How can I make my carousel photos responsive?

I have 4 different sized photos, although I manage to keep it the same size, I can’t make it look responsive in all sizes. I’ve tried all the ways I know. Since I will make a carousel with these photos, it is very important for him to be sensitive. (The solution could be JavaScript)
For demo:

1 Like