Fix in thumbnail generation