Check www.delphi3d.net they have a verry good .tga loader.
Why reinvent the wheel when there are already some verry good OpenSource projects like this.