The only way I could think of is going in the Community CSS and putting
.theme-fandomdesktop-light .dark-mode {
display: none;
}
.theme-fandomdesktop-dark .light-mode {
display: none;
}
Then where you want the images to switch depending on light/dark mode you could put
[[File:FILENAME|class=light-mode]]
For light mode and
[[File:FILENAME|class=dark-mode]]
For dark mode