It is not necessary to check if the field is empty or not, we need a file object here; and if we call the toFile() method we either get a file object if the image exists, or we get a boolean false if the field contains a value for an image that doesn’t exist (anymore) or if the field is empty.
Also, you can’t have curly braces outside of PHP code, I don’t know what you are trying to do there.