Allow image function if auth is enabled

Replaced in_array with array_key_exists
In array don't work