The slideshow is set to a fixed height, but the width changes as the viewport decreases in size, so the slides which stay at a constant aspect ratio fill up less of the fixed height. So that’s why the black gaps at the top and bottom of the slides get larger.
The usual trick to make an iframe keep aspect is to have a wrapper element for it with vertical padding set to a percentage to represent the aspect ratio. Then have the iframe fill that with both width and height at 100%.