public function get_maxwidth() {
        $param = optional_param('wikimedia_maxwidth', 0, PARAM_INT);
        $pref = get_user_preferences('repository_wikimedia_maxwidth', WIKIMEDIA_IMAGE_SIDE_LENGTH);
        if ($param > 0 && $param != $pref) {
            $pref = $param;
            set_user_preference('repository_wikimedia_maxwidth', $pref);
        }
        return $pref;
    }