Add thumnail support and other fixes