Hi Clara,
Place your image viewer widget inside a container and define specific width & height. So that image will not overflow out of the container while doing zoom in or out.
Define your container with below css code:
Add this css class to your container widget and this code to your css file.
.zoom-condition: {
width: 600px;
height: 400px;
overflow: hidden;
}