I had this exact problem and the solution that worked for me after some googling [http://gallery.menalto.com/node/95244] was to edit /etc/gallery2/config.php, and change
$storeConfig['usePersistentConnections'] = false;
to
$storeConfig['usePersistentConnections'] = true;
At that point I was then able to successfully upload images. However, the frustrating thing about this is that it still worked after reverting the change!
I had this exact problem and the solution that worked for me after some googling [http:// gallery. menalto. com/node/ 95244] was to edit /etc/gallery2/ config. php, and change
$storeConfig[ 'usePersistentC onnections' ] = false;
to
$storeConfig[ 'usePersistentC onnections' ] = true;
At that point I was then able to successfully upload images. However, the frustrating thing about this is that it still worked after reverting the change!