This is great, but something in iOS 15 caused some flickering when resizing with the "arrow.up.left.and.arrow.down.right". I narrowed the problem down to the left and right 'surrounding rectangles'. Changing the height of the left and right Rectangle() frames from "imageHeight"' to "imageHeight * 0.99" stopped the flickering. It's not a perfect fix, but it's better than the flickering. Thanks for sharing this.