Update image.php

Remove keyword static from method signature and replaced the check for a loaded resource.