Fix screenshot taking (opengl thread problem)