added helper method for saving selected photos