Refactoring drawTiles on HTML5 backend to use count flag as in native/lime