Added logic for taking screenshots with capybara and poltergeist