Media Uploader fails when post id is not passed in

This change will check if a post object is set before trying to access the object properties.  Or else 3rd party plugins which utilizes the media uploader without explicitly passing in a post id will fail.