I have this code for make a image search trough Google Image API:

```
$(document).ready(function(){
        $('#envio').click(function(){
            var iURL = "http://ajax.googleapis.com/ajax/services/search/images";
            $.ajax({
                url: iURL,
                type: 'GET',
                dataType: 'jsonp',
                data: {
                    v:  '1.0',
                    q:  $('#query').val(),
                    format: 'json',
                    jsoncallback:  '?'
                },
                success: function(data) {
                    console.log(data);
                    var html = '';
                    var j = 1;
                    $.each(data.responseData.results, function(i, v) {
                        html += '<img id="' + j + '" src="' + v.tbUrl + '" title="' + v.title + '" alt="' + v.title + '"/>';
                        j++;
                    });
                    $('body').append(html);
                },
                error: function(xhr, textStatus, error){
                    console.log(xhr.statusText, textStatus, error);
                }
            });                
        });
    });

```

I have a INPUT field and need when I click a IMG the value of SRC attribute goes there. I try with this code but didn't work:

```
$('img').click(function(){
    $.each(function(){
        $('#urlimagen').val($this.src);
    });
});

```

Also by default the first code just return 4 images and I need more than four, then my question around this code is as follow:

1. does any body know how to get more than 4 images?
2. can any help me to fix the image code? I mean when I click a image the SRC value must be in INPUT called #urlimagen.