I think I know what is going on. Right, the issue is that the 'context id' has been hard coded in frontpage.php:
This is 'bad' and will cause an issue in some Moodle installations.
The addimage.php and addimage_form.php are actaully adaptations of the Grid format editimage.php and editimage_form.php as I found the same unaltered comment:
/* No idea, copied this from an example. Sets form data options but I don't know what they all do exactly */
But, the Grid format works out the context id from the course id. And the front page is a course with $COURSE being a global it should be possible to use:
$context = context_course::instance($COURSE->id);
$contextid = $context->id;
in the frontpage.php file.
This needs to be tested.
P.S. Theme code despirately needs 'code checking'.