public function saveimageAction()
 {
     if (!$this->_helper->acl('Admin')) {
         return $this->_helper->redirectCommon('gotoLogin');
     }
     $request = $this->getRequest();
     if (!$request->isPost()) {
         return $this->_helper->redirector('addproduct');
     }
     if (false === ($id = $this->_getParam('productId', false))) {
         throw new SF_Exception('No product id sent');
     }
     $product = $this->_catalogModel->getProductById($id);
     if (false === ($id = $this->_catalogModel->saveProductImage($product, $request->getPost()))) {
         $this->view->product = $product;
         $this->view->imageForm = $this->_getProductImageForm();
         $this->view->imageForm->populate($product->toArray());
         return $this->render('productimages');
     }
     $redirector = $this->getHelper('redirector');
     return $redirector->gotoRoute(array('action' => 'productimages', 'id' => $product->productId), 'admin');
 }