I finally found that it is caused from the PHP5.5 version, and it’s because of the deprecated function mysql_connect(). I’ve benn able to solve it by changing the file /wp-includes/wp-db.php (line 1142).
$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
Change with:
$this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
This makes the gallery to work properly, waiting for the wp compatibility with PHP5.5.