testing if $im should be $img