Fix screenshot issues (fixes #781)