New method for resizing images [ci skip]