adding tile to image functionality