Generating and saving a thumbnail image