`org-create-formula-image-with-dvipng' and
`org-create-formula-image-with-imagemagick'
share a good deal of logic, so combine them to a function.