Google – Is a URL required when creating an image sitemap?

The reason I'm asking is that I'm writing a script that scans a folder for pictures so I do not necessarily know where they're used or the exact page. Example from Google


Is it possible to do that and would google / other search engines still read it correctly?