targaenc: Move size check to initialization function