Fixed TS image parsing (refact bug)