I don't understand why you need to break this out as a separate function. I see you call it from gallery.js but it looks to me like you could just call showFile() there.  If possible, please just use showFile() to keep the API simpler.