screenshot generator adapted from https://gist.github.com/nhoizey/4060568