Double buffering for the img