fix issue that only 2 imgs are persisted