Fixed screenshot generation