process to generate thumbnail