fix bug of exception on open image