Implementing image/query method from Image API to site. Modifiled image/query method