Added a check to see if there are any optional themes before trying to add them to the legend and map