Added code to remove irrelevant background information from images