---
# System prepended metadata

title: "\tfunction isValidImage(\t\tImag"

---

In my understanding...
```solidity
function isValidImage(
    Image memory img,
    bytes32 key,
    address property
) private view returns (bool) {
    return
        // solhint-disable-next-line not-rely-on-time
        //// Deadline should have the value, and it should be greater than the current timestamp.
        //// If deadline is 0, this will be true.
        !(img.deadline != 0 && img.deadline < block.timestamp) &&
        //// Members should have the value, and it should be greater than or equal to the claimed slots.
        //// If members is 0, this will be true.
        !(img.members != 0 &&
            img.members <= propertyImageClaimedSlots[property][key]) &&
        //// Members/Deadline should be greater than 0.
        !(img.members == 0 && img.deadline == 0) &&
        //// SRC should have the value.
        bytes(img.src).length != 0 &&
        //// requiredTokenAmount or requiredTokenFee should be greater than 0.
        //// This validation is somewhat redundant with `isValidStake` and can be ignored?
        (img.requiredTokenAmount != 0 || img.requiredTokenFee != 0);
}
```
this can be simplified like the following...
```solidity
function isValidImage(
    Image memory img,
    bytes32 key,
    address property
) private view returns (bool) {
    return
        (
            // If deadline is set, validates it.
            img.deadline > 0
            ? img.deadline > block.timestamp
            : true
        )
        &&
        (
            // If members is set, validates it.
            img.members > 0
            ? img.members > propertyImageClaimedSlots[property][key]
            : true
        )
        &&
        (
            img.deadline > 0 || img.members > 0
        )
        &&
        bytes(img.src).length != 0
}
```