Fix resize square image error