Fixed crash when random Exception gets caught before bmp gets initialized.
Removed unused imports.