first try to automatically rescale image and generate pixels