dg_mosaic with variable pitch