Modified jpeg saving to use ImageIO