Ok solved, I just missed the option to switch get_children with get_posts!! what a dumb!
Here is the working code if anybody needs a random image ;)
function random_image_url($size=large) {
global $post;
if ( $images = get_posts(array(
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'numberposts' => 1,
'orderby' => 'rand',
'post_mime_type' => 'image',)))
{
foreach( $images as $image ) {
$attachmenturl=wp_get_attachment_image_src($image->ID, $size);
$attachmenturl=$attachmenturl[0];
echo ''.$attachmenturl.'';
}
} else {
echo '' . get_bloginfo ( 'stylesheet_directory' ) . '/img/no-attachment.gif';
}
}