fix for non contiguous images