This is a follow-up to the answer from https://tex.stackexchange.com/a/412010/221716
As with the original question, I'd like to include the source text under the image. However, the URL is longer than the image's width, and the environment is a wrapfigure.
Latex source:
\documentclass{book}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{stackengine}
\usepackage{xurl}
\usepackage{lipsum}
\begin{document}
\begin{wrapfigure}
{r}{.25\textwidth}
\centering
\def\stackalignment{r}\stackunder{ %
\includegraphics[width=.25\textwidth]{example-image-b} %
}{\tiny Source: \url{https://www.example.org/very/very/very/very/very/very/very/long/url}}
\caption{My Caption}
\end{wrapfigure}
\lipsum
\end{document}
As a result, the URL does not take into account the width of the environment. As a result, the picture is misaligned, and the URL is not wrapped inside the appropriate width:

Surprisingly, removing \stackalignment{r} correctly wraps the URL but removes the picture:

Is it feasible to have the picture and the source aligned and wrapped correctly? Furthermore, because the text is so small, may the vertical space of the URL be reduced? Thanks
