Do not allow nonpositive numbers for canvas width and height
Change-Id: Ib3f9a623cf34d6df659ee3f7c32d1da7a36f549d