Added python3 support to img and b64img tags

This is done using a new six import, however as `six` is used by pelican
itself, this do not add a requirement.