Improved prepareMaze to keep white pixels from original image.