Dispose bitmap earlier

This fixes an exceptional resource leaked related to fixing CID18165