Avoid closing a null ProgressDialog object

**This is not a complete fix**
This change merely avoids the app crashes. The side affect that still remains is, that sometimes between screen transition Progress loader may not appear at all. 

Fixing the null pointer error caused due to null dialog. This is not a complete fix. This only avoids the error; there is a change in approach required to fix this issue in long term

Also removed unused imports.