Move logic from the view to the controller

I'm getting an 404 error because i'm trying to access to an image that
doesn't exist. I hoped this change addessed this issue, but it doesn't.
Looks like the problems come when the items array is empty. I wonder if
hidden the block when the items is empty would fix the problem.

For the bright side i was able to remove logic form the view, but i'm
not totally conformable with this change. I would like to map the item
to a local class that contains extra presentation logic