<?php
// WP_Query arguments
$args = array (
'post_type' => array( 'gallery' ),
);
// The Query
$query = new WP_Query( $args );
if(!empty($query)) {
// Here i should get the featured image now?
while ($query->have_posts()) : $query->the_post();
if ( has_post_thumbnail() ) {
the_post_thumbnail();
}
endwhile; wp_reset_query();
}else {
// Post type doesn't exist anymore.
}
?>