added logic to the canvas dimension calculation in order to restrict the dimensions on larger screens.