Added error handling for screenshots.

Seems to fail when lockscreen is on.