Improve screenshot capturing script