Added resizing of images

Now images are resized according to the preferences.