PNG: boundary check