change to setStageDimensions so it returns true/false according to whether it changed the stage dimensions. Now the mutation callback function only centres the map if the dimensions of the stage changed