Add support for TGA files.

libgd is now optional dependency.