LL-1098 #resolve Added tiff handling.
LL-1098 #resolve Added tiff handling.

Also fixed a small problem with handling jpeg in some situations.

learning-layers/BitsAndPieces,learning-layers/BitsAndPieces