The text next to an image is taken into consideration when ranking images. The more accurately the image's description corresponds to the user's query, the more likely it is that the image will be shown on the first page of search results.
In addition, the quality of the site where the image is placed, as well as the quality of the image itself, affect ranking. You can read about which sites are considered high-quality in the Tips for webmasters section in Yandex.Webmaster Help.
A link to the page that has the text description of an image that best corresponds to the words in a query is displayed in the search results for each found image.