为什么这会影响wordpress中的图像?

I'm using this code in footer.php

    <?php 
if(is_single()):
$post = $wp_query->post;
$pID = $post->ID;
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "single-post-thumbnail");
$imgURL = "" . $image[0];   
$urlstring = get_permalink();
?>

The code above is the code I'm using to call them.

This one below is the one that is making the problem for images to appear.

<div id="fb-root"></div>

<script>
function graphPublish(){
    setTimeout(
        function(){
            var title = '<?php echo $title ?>';
            var urlstring = '<?php echo $urlstring ?>';
            var picture = '<?php echo $imgURL ?>';
            FB.api('/me/feed', 'post', { message: title, link:urlstring, link:urlstring, picture:picture, name:title }, function(response) {
        });
        },
        8000);
}

What I can't understand is why does this script blocks images in the post,only in post to show up.

They are there, in the place but they are just not showing.