Fixed issue with resizing images