public function get_author_profile_image_url(author_entity $author, int $authorcontextid = null) : moodle_url {
        global $PAGE;

        $datamapper = $this->legacydatamapperfactory->get_author_data_mapper();
        $record = $datamapper->to_legacy_object($author);
        $record->contextid = $authorcontextid;
        $userpicture = new user_picture($record);
        $userpicture->size = 2;

        return $userpicture->get_url($PAGE);
    }