only retrieve posts with that meta key:
$rand_posts = get_posts(array(
'numberposts' => 4,
'orderby' => 'rand',
'post_type' => 'ansatte',
'order' => 'ASC',
'meta_key' => 'employee_pic',
));
or maybe use WP 3.1’s meta_query:
$rand_posts = get_posts(array(
'numberposts' => 4,
'orderby' => 'rand',
'post_type' => 'ansatte',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'employee_pic',
'value' => '',
'compare' => 'NOT LIKE'
),
)
));