Adding debug to gallery AJAX.