Commented displayImage()-method
Added try-catch to displayimage