the order by needs to be in the main query args and not in your meta query, along with anything else that is not part of the meta_query.
query_posts(array(
'orderby' => 'rand',
'showposts' => 1
'meta_query' => array(
array(
'key' => 'post_in_home_gallery',
'compare' => '==',
'value' => '1',
)
)
));