Add a lock mechanism on images resized generation