Fixes for session and imagemanger issues