improved screenshot capture logic, less memory usage
removed comment