create canvas in proper cases, resize canvas by max side value