fixed bug in mosaicing