public function addImage($fileId, $filterId = 0, $throwException = false)
    {
        try {
            // if the filterId is provded as a string the filter will be looked up by its name in the get filters array list.
            if (is_string($filterId) && !is_numeric($filterId)) {
                $filterLookup = $this->getFiltersArrayItem($filterId);
                if (!$filterLookup) {
                    throw new Exception("The provided filter name " . $filterId . " does not exist.");
                }
                $filterId = $filterLookup['id'];
            }

            $query = (new \luya\admin\image\Query())->where(['file_id' => $fileId, 'filter_id' => $filterId])->one();

            if ($query && $query->fileExists) {
                return $query;
            }

            $fileQuery = $this->getFile($fileId);

            if (!$fileQuery || !$fileQuery->fileExists) {
                if ($fileQuery !== false) {
                    throw new Exception("Unable to create image, the base file server source '{$fileQuery->serverSource}' does not exist.");
                }

                throw new Exception("Unable to find the file with id '{$fileId}', image can not be created.");
            }

            $model = $this->createImage($fileId, $filterId);

            if (!$model) {
                throw new Exception("Unable to create the image on the filesystem.");
            }

            $this->_imagesArray[$model->id] = $model->toArray();
            $this->deleteHasCache(self::CACHE_KEY_IMAGE);

            return $this->getImage($model->id);
        } catch (\Exception $err) {
            if ($throwException) {
                throw $err;
            }
        }

        return false;
    }