added an option to use cache or not and added actions based on the presence or absence of all thumbnails vs single thumbnail