Minor code refactoring in shaders. Added image capturing