Solving bug when changing btw glviwer and images. Works, not a good solution