small fixes

delete store image pointer before reallocating
masks are 1 everywhere by default