Optimising Chest X-Rays for Image Analysis by Identifying and Removing Confounding Factors