added condition check to not display task media more than once