optimizing removing imgs