Add a lock mechanism on image resized generation