updated updateActive function to split between subImages and links