Enhanced screenshot code