fixes 'OpenGL errors - Invalid operation' on some jpeg files