A woman who attacked her flatmate and long-term friend with a knuckle-duster after discovering a hoard of her nude images on his phone has avoided jail.