public function cropImages($request)
    {
        $path = $request['path'];
        $coords = $this->getCropCoordinates($request);
        $images = $this->getNewImages();

        $full = reset($this->_imageTypes);

        $cropperImage = $this->getTempImage();
        $cropperImage->setResourceFromFile(UPLOADS_PATH . 'tmp/' . $path);

        $originalImage = $this->getTempImage();
        $originalImage->setResourceFromFile(UPLOADS_PATH . 'tmp/' . str_replace('crop-', '', $path));

        $images[$full]->setResourceFromFile($originalImage->getFile());
        $images[$full]->save();

        $crop = next($this->_imageTypes);
        $images[$crop]->copyResource($images[$full]);

        $ratio = $images[$full]->getWidth() / $cropperImage->getWidth();
        $adjustX = round($coords['x'] * $ratio);
        $adjustY = round($coords['y'] * $ratio);
        $adjustWidth = round($coords['width'] * $ratio);
        $adjustHeight = round($coords['height'] * $ratio);

        $images[$crop]->crop(
            $adjustX, $adjustY,
            $this->getImageWidth($crop), $this->getImageHeight($crop),
            $adjustWidth, $adjustHeight);

        while ($size = next($this->_imageTypes)) {
            $images[$size]->copyResource($images[$crop])->resize()->unsharpMask()->save();
        }

        $images[$crop]->unsharpMask()->save();

        Nip_File_System::instance()->deleteFile($cropperImage->getFile());
        Nip_File_System::instance()->deleteFile($originalImage->getFile());

        return $images['default'];
    }