fixes image and gallery overlay for TEIs