added option to not keep images