Should `tileSize` be an argument to this function instead of assuming 256x256 pixels?