added jpg optimization