Check for string in URL
You can use arg to check for URL arguments. In your case, the second argument has to be empty, so you can try something like this:

if (arg(0) == 'displayimg' &amp;&amp; arg(1) == 'mypage') {
  // Do something meaningful.
}