Implement image resizing for jpeg images.