Resource picker fixes

The resource picker can be opened on the first try now.
There is still a problem I didn't managed to fix: the same modal box is always used every time the picker is opened even tought many modals can be present in the page because the resourcemanger can be instanciated multiple times.

Now all of this is working I discovered a new bug: the resource manager modal opens behind the resource creation modal if it's called from tiny mce.