Fix lock when uploading image