Resize images correctly