If you look into the actionUploadSGIcon() method in the controller, you would see that it is calling the upload method in the content_attach API to upload the image and then calling the update method in the content_channel API to update the social group channel with the uploaded image.
PHP Code:
$response = $api->callApi('content_attach', 'upload', array('file' => $_FILES['file']));
...
$response = $api->callApi('content_channel', 'update', array($_REQUEST['nodeid'], array('filedataid' => $response['filedataid'])));
You can basically do the same.