fixed memory leak issue where a new image would have every previous image's shapes