Find only those galleries with images

I believe that a relatively simple meta_query would do it.

$args = array(
    'post_type' => 'post',
    'meta_query' => array(
        array(
            'key' => '_gallery_image_ids',
            'value' => '',
            'compare' => 'EXISTS'
        )
    )
);
$query = new WP_Query( $args );

Reference:

http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)