Fix for weak open and close blocks. Added also Removal of ImageViewer