Retrieving a JSON feed of my posts and displaying thumbnails

Try something like this:

$posts = $query->get_posts();

foreach($posts as $p){

    $thumb_id = get_post_thumbnail_id($p->ID);
    $src = wp_get_attachment_image_src($thumb_id, 'image_size');

    $url = $src ? $src[0] : false;

    $p->image_url = $url;
}

$json = json_encode($posts);

Now you can echo out $json into your JS var. You will find the image url string in the key image_url of your json object. You can test if there is an image by testing if the value returned is false or not.

Be sure to change image_size in the wp_get_attachment_image_src() function to the name of the image size you want.

In essence we are looping over the query, grabbing the post thumbnail and finding the url of the image we want, then we add it to the object as a new property.

Any questions, just ask.