set thumb format depending on original file extension