Fixed bug with resizing image