public function generateUniqueFilename($originalFilename)
    {
        $index = 0;
        $filename = pathinfo($originalFilename, PATHINFO_FILENAME);
        $extension = pathinfo($originalFilename, PATHINFO_EXTENSION);

        while ($this->imageManager->findByFilename($originalFilename)) {
            $index++;
            $originalFilename = $filename . '-' . $index . '.' . $extension;
        }

        return $originalFilename;
    }