Alternately you can make this helper not require a context and just use something like:

```python
from django.utils import translation

@jingo.register.function
def rtl_img(url):
    if translation.get_language_bidi():
        root, ext = path.splitext(url)
        url = root + '-rtl' + ext

    return media(url)
```