fix screenshot problems, fixes #257, fixes #579, fixes #583