Updated javascript for media input to be generalized better so that it can better handle repeater block elements.