added method to save pictures