I have an earlier post on how to retrieve the user photo using the MS Graph but it shows you what you need to do to configure the base. HOWTO: Retrieve User Photo from Microsoft Graph
Then you can use the Graph endpoints for SharePoint to hopefully do what you need to do. Working with SharePoint sites in Microsoft Graph - Microsoft Graph v1.0 | Microsoft Docs
Hope this helps!
–Treb