Correctly setting the canvas' dimensions