GL_BGRA format and palette related fixes