Fixed #369 and gallery thumbnail