Using `substr()` as a filter here will be problematic if we make the `/files/` path a configurable setting. Thinking about a more consistent solution, I added a couple new methods to `FileManager`:

    echo FileManager::add_webroot ('foobar.txt'); // -> /files/foobar.txt
    echo FileManager::strip_webroot ('/files/foobar.txt'); // -> foobar.txt

I've pushed that to Github, so I think you should be able to replace line 32 with this:

    <a href="#" onclick="return $.filemanager ('prop', {file: '/{{loop_value->path|FileManager::strip_webroot}}'})">{"Edit Caption"}</a>

Let me know if that works, and if you can add the lines for the `$page->add_script()` (since pull requests are read-only...), and we can get this merged :)