try to limit memory usage by manually destroy\!ing images in count_colors