Implement new function for taking screenshots.