if (pixel == null) { alert("Error: Pixel not set!"); }