Added move semantics to the img grabbing function.