redrawTile function did not always have ctx passed to it, so it caused errors