Seems like regular files do not have fields like {{file.default_caption}}. If this is a regular file you'll end up calling a function like this opener.dismissRelatedImageLookupPopup(window, , , , ). Maybe it's better to find another solution for this function call.