Try to find the actual variable that is used for images instead of using a hardcoded variable name. Closes #13486