fix jpeg reading to opengl format