replaced image task with new code