latest image cleaning code