If you query via Microsoft Graph, the webUrl
for images will work the same as PDFs:
GET https://graph.microsoft.com/v1.0/sites/{site-id}/drive/items/{item-id}
Response: The webUrl
will directly reference the image file (e.g., https://contoso.sharepoint.com/sites/sitename/Shared%20Documents/image.jpg
).