Fix #117: more efficient thumbnail loading