my $images = Mojo::Collection->new;
while (defined $url) {
    my $images = $c->app->ua->get($url)->res->dom->find('img')->tap(sub {
        push @{$images}, $_;
    });
    undef $url if $images->size < $images_per_page;
}
$images = $images->flatten;