# Subfile with \includegraphics not working in the mainfile

I have a problem trying to get my maindocument to compile a subdocument, with an included figure.

I have the following file-structure setup:

 mainfile.tex
/chap
/chapter1
/ ch1.tex
/fig
image.pdf


And so my mainfile.tex document has the following preamble:

 \documentclass[12pt,a4paper,twoside,final]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{subfiles}
\usepackage{graphicx}
\graphicspath{{./chap/chapter1/fig/}}
%
%    end preamble
%
\begin{document}
\subfile{./chap/chapter1/ch1}
\end{document}


And in my subfile.tex I have the following setup:

\documentclass[../../main.tex]{subfiles}
\begin{document}
\chapter{ch1}
\includegraphics[scale=0.1]{./fig/image}
\end{document}


Now, when I compile the subfile.tex, the image is rendered nice and fine, but when I try to compile, the mainfile.tex, i get the following error from LaTeX:

The image in question is a pdf-file which I have stored in a subdirectory inside the directory where the subfile.tex is located, as should be clear from the above structure. I really can't see where it goes wrong? Is it something to do with the order in which the packages are loaded or is it something else entirely?

I really don't get why the above code does not work as intended?

Any help is much appreciated!

 \graphicspath{{chap/chapter1/fig/}{fig/}}

• For further clarification, in subfile.tex, the new command is \includegraphics[scale=0.1]{image} – David Jul 23 '19 at 20:59