There is no silver bullet here.
But I probably will end up with the following design:
IBinaryDataService:
For general saving of data as binary format. The objects to be saved must have a method to help write it into an OutputStream. There ought to be a convinent method to load it into the original Object too.
IDataIndexService:
For index of data attributes/tags, to help in searching as well. Correspond closely to the data of pic you described.
IPicRepo:
Only interface exposed to the client. Clients should use this, and never know about the above two services.
FileSystemBinaryDataServiceImpl:
Implementation of the IBinaryDataService above.
DbDataIndexServiceImpl:
Implementation of the IDataIndexService above.
PicRepoImpl:
Implementation of the IPicRepo above. Use spring to inject FileSystemBinaryDataServiceImpl and DbDataIndexServiceImpl as dependencies.
Additional extensions if you wish:
IPersistentModel:
Representation of an object that can be persisted. Has methods write(OutputStream), read(inputStream), and getAttributes():Map
PicModel:
Implementation of IPersistentModel above.
PS. This is just a general high level overview.