for my $ext (@image_extensions) { if ($url =~ /\.$ext$) {