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