improved saveScreenshot + tests