Update TileManager.js to fix resize issues

This should fix comment #1302