Fix for ipynb template

- Escape all text input and output. This is require to avoid
  troubles with `<`, `>` and other characters that have special
  meaning in HTML
- Replace markdown syntax for images output with HTML