private function getDimensionsFromDB($dim = "string") {
        $imageDimensions = $this->ImageDim;
        if (!$imageDimensions) {
            return null;
        }
        if ($dim === 'string') {
            return $imageDimensions;
        }
        $widthAndHeight = explode('x', $imageDimensions);
        if (!isset($widthAndHeight[$dim])) {
            return null;
        }
        return (int)$widthAndHeight[$dim];
    }