I have made a custom command which includes an image if it exists and writes an missing file text if it does not. The problem is that if I use underscore in the file name or path it is does not print the path right.
\documentclass[a4paper, 10pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[export]{adjustbox}
\newcommand{\includegraphicsmaybe}[2]{
\IfFileExists{#2}
{\includegraphics[valign=c, width=#1]{\detokenize{#2}}}
{\fbox{\parbox[c][#1][c]{#1}{\center \textbf{File not found}\\ \detokenize{#2}} }}}
\begin{document}
\centering
\includegraphicsmaybe{0.4 \textwidth}{example-image}
\includegraphicsmaybe{0.4 \textwidth}{something.png}\\[1cm]
\includegraphicsmaybe{0.4 \textwidth}{something_1.jpg}
\includegraphicsmaybe{0.4 \textwidth}{something_1.png}
\end{document}
How can I solve this?