fixes and cleaning around thumbnail creation