resize image to fit canvas's size