Listing items in listbox without certain extensions

I have a list of items in a listbox. I now want to list these same items in a second listbox but without files with extensions of ".gif" and ".jpg". I have tried the following code but it doesn't work. Why? I am using Delphi 6. Many thanks for your help.

i := 0;
repeat
begin

if (ExtractFileExt(ListBox1.Items.Strings[i]) <> '.gif') or (ExtractFileExt(ListBox1.Items.Strings[i]) <> '.jpg) then
ListBox2.Items.Add(ListBox1.Items.Strings[i];

You may be able to speed the process up a little bit, and make it more reable with something like:

var
E:string;

i := 0;
repeat
begin
E:=lowercase(ExtractFileExt(ListBox1.Items.Strings[I]);
if (E<>'.gif') and (E<>'.jpg') //easy to add more tests here...
then
ListBox2.Items.Add(ListBox1.Items.Strings[i];
end;
inc(i);
until i = ListBox1.Items.Count;