Adding function to clean images