Musk’s Grok chatbot had been generating sexualized images of women, children and minors on social media platform X in response to user requests.