The important thing is to be as discreet as possible. It would be best if you could avoid them thinking you know the content of the pictures at all. Hopefully, you stopped viewing them when you realized what the content of one of them was. Depending on the contents of the folder, you may be able to get away with an innocuous email about image files being stored in a public folder. I'm assuming you can tell which of the owners created the files by looking at the properties.
Case 1: The owners think the files may be private (e.g. they're in a folder \\computer\\share\\BossName
), but they don't realize the folder is public. In this case, you could simply email them saying they have a public folder shared and ask them if they would like to make it private, then you could simply alter the permissions and not hint that you've looked at any of the files.
Case 2: The images are in a folder where there probably shouldn't be images, e.g. they're in \\computer\\share\\Spreadsheets
. You could email the person that created the files, saying there are a bunch of image files in this directory and ask if the images belong in a Spreadsheets folder, or if they should be moved somewhere else.
Case 3: It is REALLY messy, all kinds of files are in the folder and they don't clearly belong to one of the Bosses. In this case you could email them saying the public folder is full of a mishmash of file types and tell them you'd like to separate them by type like images, spreadsheets, text files and ask them to take a look since they created some of those files.
In all cases, I think you should be discreet. If they come right out and ask you if you viewed any of the images, you should tell the truth:
Yes, I opened one not knowing what the content might be and wanted to save you any embarrassment by letting you handle it. These are public files at the moment and any user in the network could stumble across them so we should move them or protect them so people don't have access.
This is assuming that you didn't spend 30 minutes viewing all the pictures like a creep :)