I have another solution instead of using named (strings) or integer mappings. I know, my solution is basically a tiny bit more code and its work, but the main reason I would do it differently is refactoring and changes. You want the editor to tell you if a resource is missing, so you can react. also it helps a lot, if youre not bound to filename changes etc.
as far as I understand, you need to access local images from other sources, that do not know those images. if this is correct, then it is best to use some kind of self-made image-ids. lets say you have resource aa.jpg and bb.png. That would translate to something like this:
Map<String, Integer> map
map.put("drawable_aa",R.drawable.aa);
map.put("drawable_bb",R.drawable.bb);
this allows you now to do a lookup which resource might match. You should NOT store this in a database, but build this lookup table somewhere in your application on startup (application, singleton, something you inject, however you do it).
This will allow you now to have changes like refactoring, where the name of aa.jpg could change to cc.jpg, and would match to:
map.put("drawable_aa", R.drawable.cc);
and therefore not even break anything. also it allows you to have free mappings on whatever you want and just change things here.
It will also complain while complaining, if something is missing.
one thing to note - make some getter function instead of accessing the map directly, that will check if the element is present. if youre returning int, then you need to have some resource set and most often its much easier code if you do not have to check everywhere if that resource is present, but it will still work - for example by using a "missing_resource.jpg" that is returned as resource, if its missing. that way its easily visible. of course you can still make something that checks and hides, but as said, then you gotta do this everytime and thats not always feasable.
hope that helps