Changed the CheckValidImage to use a file stream too, seems to ensure it does not lock