Fixed issue, if PNG is not on last iteration.