protected function processProfilePicture($node)
    {
        $pictureNode = $node->getChild('picture');

        if ($pictureNode != null) {
            if ($pictureNode->getAttribute('type') == 'preview') {
                $filename = $this->dataFolder.Constants::PICTURES_FOLDER.DIRECTORY_SEPARATOR.'preview_'.$node->getAttribute('from').'jpg';
            } else {
                $filename = $this->dataFolder.Constants::PICTURES_FOLDER.DIRECTORY_SEPARATOR.$node->getAttribute('from').'.jpg';
            }

            file_put_contents($filename, $pictureNode->getData());
        }
    }