add function to display post thumbnails