Better handle image file locking when reading image properties