Targa fixes

1. From Michel Lerenard, a more robust check for presence of alpha. The previous check could fail for certain alpha flag, incorrectly thinking it was a 2-channel image instead of 1, or 4 channel instead of 3.

2. In the process of checking this result against various test cases, LG also noticed that we were incorrectly decoding 16 bit palette images by swapping the R and B channels, and there's a fairly obvious fix for that (also a slight simplification of code nearby).