ImagesHandler thumbs generation improvement and small fixes