changed way images are generated