Easier way to write if else statement

Tried the resize function for my graphic, unfortunately it seems to apply anti-aliasing even though no smooth is on