More sapply to vapply and removed unused images