It depends whether you consider products without any images to be "invalid" / "inactive", or if you just don't want to show them in this particular view.
Your controller is defining a business requirement like "fetch all products which match certain conditions". If "has an image" is part of that business requirement, because any product without an image should not be on sale, then the logic goes in your controller.
Your view is defining a particular presentation like "arrange the products in a pretty grid". If "has an image" is just a requirement to work in this layout, skipping here could be reasonable.
However, completely skipping products in the view may have some undesirable consequences:
- If these products should be on sale, as implied by the controller returning them, hiding them means customers can't see them.
- If you have pagination, or a total number of results found, it won't match the number of products the user can actually see unless you take care to handle the skipped products.
It's therefore most appropriate if you are building some kind of "highlights", where the skipped products will actually be shown in a list further down, just not as prominently.