Fixed logic of work with screenshots.