Improved showing/hiding of images and handling of errors