Fixed a bug in ViewerInstance in they way the texture width and height
was computed.
Also fix a race condition in the ViewerGL