Fixed parseMediaPaths

Fixed the case where some media paths were being set to undefined.
Iteration issue as to how $.each works.