This function is used to download images from a variety of formats: BMP , gif , png , jpeg , tiff , ico , etc. no problem. The main thing you need to do is save images with the same extensions that they were then to avoid confusion. I kept the names of the files that are taking direct links to pictures. To get the name of the file Url use function

function  ExtractUrlFileName ( const AURL: string ): string; 
var
I: Integer;
begin
I: = LastDelimiter ('/', AURL);
Result: = Copy (AURL, I + 1, Length (AUrl) - (i));
end;