public function postAction($id, Request $request)
    {
        try {
            $mediaManager = $this->getMediaManager();
            $systemCollectionManager = $this->get('sulu_media.system_collections.manager');

            $locale = $this->getLocale($request);

            $media = $mediaManager->getById($id, $locale);
            /** @var MediaInterface $mediaEntity */
            $mediaEntity = $media->getEntity();

            $data = $this->getData($request, false);

            // Unset id to not overwrite original file
            unset($data['id']);

            if (null !== $mediaEntity->getPreviewImage()) {
                $data['id'] = $mediaEntity->getPreviewImage()->getId();
            }
            $data['collection'] = $systemCollectionManager->getSystemCollection('sulu_media.preview_image');
            $data['locale'] = $locale;
            $data['title'] = $media->getTitle();

            $uploadedFile = $this->getUploadedFile($request, 'previewImage');
            $previewImage = $mediaManager->save($uploadedFile, $data, $this->getUser()->getId());

            $mediaEntity->setPreviewImage($previewImage->getEntity());

            $this->getDoctrine()->getManager()->flush();

            $view = $this->view($previewImage, 200);
        } catch (MediaNotFoundException $e) {
            $view = $this->view($e->toArray(), 404);
        } catch (MediaException $e) {
            $view = $this->view($e->toArray(), 400);
        }

        return $this->handleView($view);
    }