Fix #248 : use better algorithm for thumbnailing
Add filter argument to thumbnail method