added data validation to canvas and pixel models