fixed bugs for creating same images.