Fixed image upload permission problem by amending variable passed to raw view once image has been uploaded.