Create the screenshot directory if it doesn't already exist
Check the return value instead of simply checking the error