To die from/of can be interchangeable with very little difference
He died of a heart attack / he died from a heart attack,
I don't think a rule exists, it is just personal preference.
On my mind - to think about someone/something
In my mind - to mentally visualize something