Support tiling an image on bricks

TODO: refactoring