fixed error with checking for visible images