fixed bad loop and broken img urls