now checking if context is valid when dispatching RESIZE event (closes #528)
Merge branch 'master' into develop