added helper function for saving of thumbs