Update attachment.php

Corrected the if clauses to be syntactically correct.