fixes and cleaning around thumbnail creation
fix building detection