Mosaic: fix bug with double reprojection; optimize _get_layer_mask