protected function cropAlternative(FormInterface $form)
    {
        $needFlush = false;
        foreach ($this->thumbnailConfig as $format => $parameters) {
            $x = $form->get('coordinates')->get($format)->get('x')->getData();
            $y = $form->get('coordinates')->get($format)->get('y')->getData();
            $h = $form->get('coordinates')->get($format)->get('h')->getData();
            $w = $form->get('coordinates')->get($format)->get('w')->getData();
            if (null !== $x && null !== $y && null !== $h && null !== $w) {
                $media = $form->getData();
                $this->imageAlternativeStrategy->cropAlternative($media, $x, $y, $h, $w, $format);
                $this->objectManager->persist($media);
                $needFlush = true;
            }
        }
        if ($needFlush) {
            $this->objectManager->flush();
        }
    }