Use scaled images and make the code error working