Speed up thumbnail purging a bit for stash script

Change-Id: Ie0f3d5aa505a5c1554d7932d38ba376811590df1
(cherry picked from commit c674d4c90c40d18187d893ed7a7ea94f43a1a624)