Edge tiles should not extend beyond the layer size …
Instead of uniformly sizing tiles, size edge tiles to fit the layer boundary (plus whatever is needed to round to the pixel boundary). This should save memory along layer edges.