From http://bgrins.github.io/devtools-snippets/#dataurl