Add unit tests for image formats and embeds template tags

Theres a bit of repeated code here, could you move the common tests into a separate class and inherit from it.

Heres an example: https://github.com/torchbox/wagtail/blob/master/wagtail/wagtailsearch/tests/test_backends.py#L17