private function saveImageContents(Image $client, SourceImage $image, $saveTo, OutputInterface $output, $stackName = null, $format = 'jpg')
    {
        if (!$stackName) {
            $output->writeln('Getting source image contents for <info>'.$image->hash.'</info> from <comment>'.$image->organization.'</comment>');
        } else {
            $output->writeln('Rendering image  <info>'.$image->hash.'</info> from <comment>'.$image->organization.'</comment> on stack <info>'.$stackName.'</info>');
        }

        $contents = $this->rokkaHelper->getSourceImageContents($client, $image->hash, $image->organization, $stackName, $format);
        if (!$contents) {
            $output->writeln($this->formatterHelper->formatBlock([
                'Error!',
                'Error getting image contents from Rokka.io!',
            ], 'error', true));

            return false;
        }

        // TODO: verify if target file exists, ask for permission to overwrite unless --force
        $ret = file_put_contents($saveTo, $contents, FILE_BINARY);
        if (false == $ret) {
            $output->writeln($this->formatterHelper->formatBlock([
                'Error!',
                'Error writing image contents to <info>'.$saveTo.'</info>!',
            ], 'error', true));

            return false;
        }

        $output->writeln('Image saved to <info>'.$saveTo.'</info>');

        return true;
    }