Formation and decomposition of N‐alkylnaphthalimides: experimental evidences and ab initio description of the reaction pathways