A T.38 gateway is really just the modem section to take FAX analog "audio" data on the phone line and turns it a straight binary digital packet stream of lower level T.30 HDLC data. The T.38 standard does specify some level of application level decoding to extend the timers in certain FAX acknolwedgement handshakes....in effect the T.38 gateway buys some time at his end with the FAX machine at the other end of the phone call while stuff makes it through the IP network...especially if there is packet loss etc. However, all of that is going on between the T.38 gateway and the FAX machine....not towards the IP network.
So, if you really want to peer into the IP packet end of the T.38 gateway and actually want to get access to the FAX'ed document images and render that as TIFF, what you really are looking for is T.30 FAX Termination since T.30 specifies the format of the HDLC data and how to encode/decode that content. In effect, you have to implement the FAX machine's logic to capture the documents into TIFF in the same way that a real FAX machine would have captured the images and printed to paper.
ie: What you are really for is a T.30 implementation, not a T.38 implementation. Note that part of the the T.30 standard also references T.4 which describes how the the actual image data is compressed within the context of T.30.
Relative to going from T.38 to T.37, while I suppose that would be theoretically possible, understand that just like T.38, the T.37 standard assumes that one end of such a gateway is the analog domain. That is, the standard of T.37 specifies how to go from analog to an email message in the same way that T.38 goes from analog to real-time digital packet stream. In the context of the standards there is no "double hop" from T.38 to T.37 to get to your FAX images....so I think finding an existing implementation seems unlikely.
In the end, what you need is a T.30 FAX termination implementation since the T.38 gateway you are talking to is already doing the modem part for you. Alternatively, another way of looking at this is that you want a T.37 gateway instead of a T.38 gateway.