fix thumbnail handling