Fix screenshot generation